if [ "$USER" == "root" ]; then
    for ((i=1; i<=3; i++)); do
        echo $i > /proc/sys/vm/drop_caches
    done
else
    echo "You need root privileges to execute this script."
fi